package com.xinghou.platform.dao.main;

import com.xinghou.platform.entity.req.ListReq;
import com.xinghou.platform.model.main.Subject;
import com.xinghou.platform.model.main.SubjectBrowse;
import com.xinghou.platform.model.main.SubjectReply;
import com.xinghou.platform.model.main.SubjectReplyPraise;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by qingshengzheng on 16/6/23.
 */
@Repository("SubjectDAO")
public interface SubjectDAO {

    public Long pubSubject(Subject subject);

    public void updateSubject(Subject subject);

    public void updateSubjectReply(SubjectReply subjectReply);

    public void insertSubjectStatistics(Long subject_id,Long join_num);

    public void delSubject(Long id,String operator);

    public Subject getSubjectDetail(Long id);

    public void addSubjectJoinNum(Long id,Long uid);

    public SubjectReply getSubjectReplyById(Long replyid);

    public Long subjectReply(SubjectReply reply);

    public List<String> getHotReplyIds(Long id,int count,Long nowtime);

    public List<String> hotSubjectReplysList(Long id,int count);

    public List<SubjectReply> getReplys(Long subjectid, Long startno, int rownum,Long nowtime);

    public List<SubjectReply> getReplysByTimestampUp( Long subjectid, Long timestamp, int rownum,Long nowtime);

    public List<SubjectReply> getReplysByTimestampDown( Long subjectid, Long timestamp, int rownum,Long nowtime);

    public List<SubjectReply> subjectReplyList(ListReq listReq);

    public void delSubjectReply(Long id,Long subjectid);

    public void addSubjectReplyPraise(SubjectReplyPraise praise);

    public Long getSubjectReplyPaiseCount(Long replyid);

    public Subject getLastSubject(Long timestamp);

    public String getSubjectJoinNumber(Long subject);

    public String getSubjectRealJoinNumber(Long subject);

    public String getSubjectReplyNumber(Long subject);

    public String getSubjectShareNumber(Long subject);

    public String getSubjectClickNumber(Long subject);





    public List<Subject> getSubjects(Long startno, int rownum,Long timestamp);
    public void likeReply(SubjectReplyPraise subjectReplyPraise);

    public List<Subject> getSubjectList(ListReq listReq);

    public boolean isPraised(String replyid, String uid);

    public void updateLikeCount(Long replyid);

    public void addSubjectBrowse(SubjectBrowse subjectBrowse);

    public void updateSubjectShareCount(String subjectid);

    public void updateSubjectClickCount(String subjectid);

    public void updateSubjectJoinCount(String subjectid);

    public void updateSubjectJoinRealCount(String subjectid);

    public void addSubjectReplyCount(String subjectid);

    public void remSubjectReplyCount(String subjectid);

    public Integer praisedCount(String replyid, String uid);

    public void updateRandomJoinnum(Long subjectid,int randomjoinnumber);

    public List<Subject> getLastThreeDaySubject(Long timestamp,Long nowtime);

    public void editSubjectJoinNum(Long subjectid,int joinnum);

    public List<SubjectReply> getUserSubjectReply(ListReq listReq);

}
